package com.komodo.island.gdx.dialog;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.actors.Button;
import com.komodo.island.gdx.KomodoIsland;
import com.komodo.island.gdx.Persistence;
import com.komodo.island.gdx.screen.Screen;

public abstract class MapDialog extends Dialog {

	public Button back;
	
	public MapDialog(float width, float height, boolean stretch, Screen screen,Texture texture,KomodoIsland komodoIsland) {
		super(width, height, stretch, screen,texture,komodoIsland);
		// TODO Auto-generated constructor stub
		
	}
	
	@Override
	public void init() {
		// TODO Auto-generated method stub
		setBackground(480*3, 320, 480, 320);
		back = new Button("back", new TextureRegion(komodoIsland.buttonTexture,
				90 + 63 + 64 * 4, 200, 32, 32), new TextureRegion(komodoIsland.buttonTexture, 90
				+ 63 + 64 * 4 + 32, 200, 32, 32));
	}
	
	@Override
	public void addElements() {
		// TODO Auto-generated method stub
		addActor(back);
	}
	
	@Override
	public void setTheListener() {
		// TODO Auto-generated method stub
		back.clickListener = new Button.ClickListener() {
			
			public void clicked(Button arg0) {
				// TODO Auto-generated method stub
				if (Persistence.sound)
					komodoIsland.dialogSound.play(1);
				screen.exitScreen();
			}
		};
	}
	
	@Override
	public void setThePosition() {
		// TODO Auto-generated method stub
		back.x = 16;
		back.y = 16;
	}

	

}
